//中文
var data_zh = ['你知道吗', '六月', '一日', '星期一', '是', '儿童节'];
//英语
var data_en = ['do you know', 'June', 'One day', 'Monday', 'Yes', 'Children\'s day'];

var fl = document.querySelector('.fl');
var fr = document.querySelector('.fr');

//中文转英文的函数
function  zhToEn(){
	for(var i = 0; i<data_zh.length; i++){
		if(fl.value == data_zh[i]){
			fr.value = data_en[i];
		}
	}
}

//英文转中文的函数
function  enToZh(){
	for(var i = 0; i<data_zh.length; i++){
		if(fl.value == data_en[i]){
			fr.value = data_zh[i];
		}
	}
}

var txt1 = document.querySelectorAll('.txt1');
var btn = document.querySelectorAll('.btn1')
//点击翻译-切换翻译语言的函数
function switchLan(){
	for(var i = 0;i<txt1.length;i++){
		if(txt1[i].className == 'txt1 col'){
			txt1[i].className = 'txt1'
		}else if (txt1[i].className == 'txt1') {
			txt1[i].className = 'txt1 col'
		}
	}
	for(var i = 0;i<btn.length;i++){
		if(btn[i].className == 'btn1'){
			btn[i].className = 'btn1 btn2'
		}else if (btn[i].className == 'btn1 btn2') {
			btn[i].className = 'btn1'
		}
	}
}